//
//  SearchVaccinController.h
//  Cabinet
//
//  Created by Florent Montsegur on 23/08/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "Vaccin.h"

@interface SearchVaccinController : NSWindowController<NSTableViewDataSource>{
@private
    NSMutableArray *mVaccins;
    NSTableView *__unsafe_unretained mVaccinsView;
    
    NSManagedObjectContext * mManagedObjectContext;
    
    NSEntityDescription *mVaccinationEntity;
    
    NSInteger mSelectedIndex;
    int mResult;
}

@property (nonatomic, strong) NSManagedObjectContext * mManagedObjectContext;
@property (unsafe_unretained) IBOutlet NSTableView *mVaccinsView;
@property (nonatomic, strong) NSEntityDescription *mVaccinationEntity;

// NSTableViewDataSource
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;

- (NSInteger) count;

- (IBAction)okAction:sender;
- (IBAction)annulerAction:sender;

- (void) closeWindow;
- (void) withParentWindow:parentWindow;
- (int) returnCode;
- (void) setVaccins:(NSArray*)aVaccinsList;


- (Vaccin*)getVaccinAtIndex:(NSInteger)aRowIndex;
- (Vaccin*)selectedVaccin;

- (IBAction)supprimerAction:sender;


@end
